<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:space="preserve"
        xmlns:xen="http://xendri.ru/">
    <xsl:output method="html" indent="yes" encoding="UTF-8" />
    <xsl:template match="recordset" name='part' mode='novelty-part-index'>
                    <table class='part'><xsl:attribute name='id'>folder-<xsl:value-of select="./mixedrecord[1]/folder/html_id"/></xsl:attribute>
                        <tr>
                            <td class='nh'>
                                <xsl:if test='//folder[@id = 2]'>
                                    <a id='addnovelty' href='/news/add.html' title='Добавить новость'>+</a>
                                </xsl:if>
                                <xsl:value-of select='./mixedrecord[1]/folder/name'/>:  </td>
                            <td class='nh'>
                                <xsl:if test='//folder[@id = 2]'>
                                    Ранее:
                                 </xsl:if>
                            </td>
                        </tr>
                    <tr>
                        <td class='ld1'>
                            <a href='#' class='novelty'><xsl:attribute name='id'>novelty-<xsl:value-of select="./mixedrecord[1]/novelty/@id"/></xsl:attribute><xsl:attribute name='href'>/news/<xsl:value-of select='substring(./mixedrecord[1]/novelty/writed, 1, 4)'/>/<xsl:value-of select='substring(./mixedrecord[1]/novelty/writed, 6, 2)'/>/<xsl:value-of select='substring(./mixedrecord[1]/novelty/writed, 9, 2)'/>/<xsl:value-of select='./mixedrecord[1]/novelty/url_title'/>.html</xsl:attribute>
                                <img width='200px'><xsl:attribute name='src'>/<xsl:value-of select='./mixedrecord[1]/novelty/image'/></xsl:attribute></img>
                                <b class='title'><xsl:value-of select="./mixedrecord[1]/novelty/title"/></b>
                                <b class='date'><xsl:value-of select="./mixedrecord[1]/novelty/writed"/></b>
                                <p class='text'>
                                    <xsl:value-of select="./mixedrecord[1]/novelty/text"/>
                                </p>
                                <div class='fader'>&amp;nbsp;</div>
                            </a>
                        </td>
                        <td class='ld2'>
                            <xsl:for-each select='mixedrecord'>
                                <xsl:if test='/recordset/mixedrecord[1]/novelty/@id != ./novelty/@id'>
                                        <a href='#' class='novelty'><xsl:attribute name='id'>novelty-<xsl:value-of select="./novelty/@id"/></xsl:attribute><xsl:if test='./novelty/top > 0'><xsl:attribute name='class'>novelty important</xsl:attribute></xsl:if><xsl:attribute name='href'>/news/<xsl:value-of select='substring(./novelty/writed, 1, 4)'/>/<xsl:value-of select='substring(./novelty/writed, 6, 2)'/>/<xsl:value-of select='substring(./novelty/writed, 9, 2)'/>/<xsl:value-of select='./novelty/url_title'/>.html</xsl:attribute>
                                        <img><xsl:attribute name='src'>/<xsl:value-of select="./novelty/image"/></xsl:attribute></img>
                                        <xsl:value-of select="./novelty/title"/>
                                    </a>
                                </xsl:if>
                            </xsl:for-each>
                        </td>
                    </tr>
                    </table>

    </xsl:template>
</xsl:stylesheet>